<?php
error_reporting(0);
session_start();
if(isset($_SESSION['email']))
{
//	$con=mysql_connect('localhost','root','root') or die('server not found');
//	mysql_select_db("webphp",$con) or die('db not found');
	
	include "dbconnect.php";
	$email=$_SESSION['email'];
	//If faculty set, his/her online status to offline
	if($_SESSION['usertype'] == "faculty")
		mysql_query("UPDATE  faculty  SET onlineStat = '0' WHERE  email =  '$email'");

	unset($_SESSION['email']);
	unset($_SESSION['usertype']);	
}
//Redirect to index page
header("location:index.php");
?>
